from func.search.search_core import SearchCore
from func.log.default_log import DefaultLog
from func.translate.baidu_translate import BaiduTranslate

if __name__ == '__main__':
    log = DefaultLog().getLogger()
    searchCore = SearchCore()
    baiduTranslate = BaiduTranslate()

    question = "Text2SQL研究现状如何，面临哪些挑战"
    log.info("原问题：" + question)
    question = baiduTranslate.translate(question, "zh", "en")
    log.info("翻译：" + question)

    # 搜索知识文献
    datalist = searchCore.search_konwledge(question)
    log.info("文献数据：" + str(len(datalist)))
    # 抽取文章摘要信息
    abstractlist = searchCore.abstract_extract(datalist)
    log.info("摘要数据：" + str(len(abstractlist)))
